/**
 * This code is part of the Bumpslide Library by David Knape
 * http://bumpslide.com/
 * 
 * Copyright (c) 2006, 2007, 2008 by Bumpslide, Inc.
 * 
 * Released under the open-source MIT license.
 * http://www.opensource.org/licenses/mit-license.php
 * see LICENSE.txt for full license terms
 */ 
package {
	import com.bumpslide.tween.FTween;	import com.bumpslide.ui.Applet;	import com.bumpslide.ui.Component;	import com.bumpslide.ui.TextBox;	import com.bumpslide.util.Align;		import flash.filters.GlowFilter;	import flash.text.TextFormat;	
	/**
	 * Sample Applet
	 *  
	 * @mxmlc -sp=../../classes -default-background-color 0x333366 -default-frame-rate 31
	 * @author David Knape
	 */
	public class SampleApplet extends Applet {

		private var message:TextBox;		

		/**
		 * Called during initialization
		 */
		override protected function addChildren():void {
			
			// Create some text
			message = new TextBox("Hello, World.\n\nIt's nice to see you again.", new TextFormat("Helvetica Neue", 50, 0xddeeff, true));			
			message.width = 400;
			message.filters = [new GlowFilter(0x000000, .3, 12, 12, 2, 2)];	
			message.visible = false;
			addChild(message);
			FTween.fadeIn(message, 500);	
		}

		/**
		 * Applets are resized when stage size changes, so re-center content during redraw
		 */
		override protected function draw():void {
			// center the message
			Align.center(message);
			Align.middle(message);
		}
	}
}
